package widget.book.viewer
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.DisplayObject;
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.URLRequest;
	
	public class BasePageViewer extends Sprite{
		protected var uLoader:Loader = null;
		protected var urlRequest:URLRequest = null;
		
		protected var pageWidth:int = 0;
		protected var pageHeight:int = 0;
		
		protected var pageBitmapData:BitmapData = null;
		public var pageBitmap:Bitmap = null;
		public function BasePageViewer()
		{
			super();
		}
		
		protected function completeHandler(e:Event):void {
		}
		
		public function load(url:String) {
			uLoader = new Loader();
			urlRequest = new URLRequest(url);
			
			uLoader.load(urlRequest);
			uLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
		}
		
		public function set position(value:Number):void {
			
		}
		
		public function get cacheBitmap():Bitmap {
			return pageBitmap;
		}
		
		public function get sourceObject():DisplayObject {
			return uLoader;
		}
		
		public function clone():BasePageViewer{
			return null;
		}
	}
}